UNIX TOOLS FOR FORMER MAC DEVELOPERS

Copyright 1995-1996 Kent Sandvik, All Rights Reserved.
$Date: 1996/03/04 22:13:53 $, $Revision: 1.1 $.




Recently I switched job positions to a place where most of the development work is done using UNIX (SGI IRIX) workstations. For the last years I have used integrated development environments, primarily Metrowerks, on the Macintosh platform. I do have a background using UNIX development tool. However, it felt awkward to switch over from an integrated environment to a system where you are more bound to command line interface tools. One exception is the MPW development environment, even if we at Apple used MPW a lot for internal development work, but in most cases it's more practical to use an integrated development tool.

What I documented were the steps I took in order to put together a nice UNIX development environment that resembled the Mac one I used earlier.

Editor

Of all the editors out there, I prefer XEmacs. Why? Mostly because XEmacs has a nice menu bar environment, including a pop-up menu with the right-most mouse button. This way I could use the environment without remembering all the specific Emacs key bindings. However, after a while I learn what each binding is named, and this way I start to make short cuts without using the menus. XEmacs has many other nice features, a colorization mode of source code including smart bounds checking of parenthesis, and so on.

Note that XEmacs is separate from GNU Emacs, see the XEmacs home page for more information including a FAQ. This FAQ and much more information is part of the XEmacs editor environment itself. There's also a newsgroup called comp.emacs.xemacs that I recommend to read in order to get up to speed with the editor environment.

Specific Key Commands

Metrowerks and similar tools have simple key commands for the most common compile/link/debug functions. In the case of Metrowerks, you use Command-C to compile, or you could actually issue Command-R, and this will compile any files that have been modified, link the binary, and start the application. If you hit Option-Command-R, then the application will start with the debugger and stop on the first line.

There are similar UNIX solutions, for instance CaseVision for SGI/Irix. In the case of XEmacs I'm using specific key bindings that I define inside the .emacs file, for example:

(global-set-key "\ec" 'compile)
(global-set-key "\es" 'grep)

In the first example the Escape/Alt key is bound to to the c key, so that Alt-C means trigger the compile function. This function will actually execute a make call using a Makefile.

In the second example Alt-s is bound to the search function (an XEmacs grep wrapper environment) for global search in the same directory. You could extend the system this way by binding keys to other common operations that XEmacs supports in forms of a function. This means that you need to know more about the XEmacs internals, what functions are available.

However, you could also trigger various other functions directly via a Makefile.

Makefile Tweaking

Inside a Makefile you could specify all kinds of mappings between make calls and what the make call will achieve. For example:

run:   all install
       myapplication

print:
       vgrind -lc++ $(HEADERS) $(C++FILES)

backup:
       cp $(HEADERS) Backup/
       cp $(C++FILES) Backup/
       cp Makefile Backup/

For instance,

make run

will trigger a call to compile all files that have been modified, and then myapplication will run.

make print

is using a UNIX specific pretty printer system that create Postscript files with highlighting of source code using bold text, and this also prints the created Postscript file.

make backup

will do a backup of a list of specific files defined. Nothing hinders to create more similar make triggered functions that you could directly issue from the XEmacs environment.








$Revision: 1.1 $, $Date: 1996/03/04 22:13:53 $.
Copyright 1995 Kent Sandvik, All Rights Reserved.